package sfeir.ergosum.adapter;

import sfeir.ergosum.R;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;

public class GalleryAdapter extends BaseAdapter {

    private Context mContext;

    public final static int PHONE = 0;
    public final static int MAIL = 1;
    public final static int WEB = 2;
    public final static int ALL = 3;
    public final static int ADDRESS = 4;
    public final static int ABOUT = 5;

    private int[] mImageIds = { R.drawable.phone_mobile, R.drawable.email, R.drawable.network, R.drawable.small_icon,
            R.drawable.house, R.drawable.about };

    public GalleryAdapter(Context c) {
        mContext = c;
    }

    public int getCount() {
        return mImageIds.length;
    }

    public Object getItem(int position) {
        return position;
    }

    public long getItemId(int position) {
        return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
        ImageView i = new ImageView(mContext);

        i.setImageResource(mImageIds[position]);
        i.setLayoutParams(new Gallery.LayoutParams(80, 50));

        i.setScaleType(ImageView.ScaleType.CENTER_INSIDE);

        return i;
    }

}
